package promogui;

import java.awt.Color;
import java.awt.Paint;
import java.util.ArrayList;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.data.category.CategoryDataset;

public class ProjectsOverviewBarRenderer extends BarRenderer
{
    ArrayList<Boolean> list;
    public ProjectsOverviewBarRenderer()
    {
        super();
        list = null;
    
        
    }    
    
    
    public ProjectsOverviewBarRenderer(ArrayList<Boolean> list)
    {
        super();
        this.list = list;
    
        
    }
    
    
    public Paint getItemPaint(final int row, final int column) 
    {
        if (list == null)
        {
        CategoryDataset dataset = getPlot().getDataset();
        
        String rowKey = (String) dataset.getRowKey(row);
        String colKey = (String) dataset.getColumnKey(column);
        
        double value = dataset.getValue(row, column).doubleValue();
                
        if (value < 100.0)
        {
            return Color.RED;
        }
            return Color.GREEN;
        

        }
        else
        {
            if(list.get(column))
                return Color.RED;
            else
                return Color.GREEN;
            
            
        
        
        }
        
    
        
    }
}
